﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using netCoreStudy.Attr;
using netCoreStudy.IService;

namespace netCoreStudy.Controllers
{
	// [ApiController]
	// [Route("api/weather")]
	// public class WeatherForecastController : ControllerBase
	// {
	// 	private static readonly string[] Summaries = new[]
	// 	{
	// 		"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
	// 	};
	//
	// 	private readonly ILogger<WeatherForecastController> _logger;
	// 	private readonly IConfiguration _configuration;
	// 	private readonly ICustomerService _customerService;
	// 	private readonly ITestService _testService;
	//
	// 	public WeatherForecastController(ILogger<WeatherForecastController> logger,
	// 		IConfiguration configuration,
	// 		ICustomerService customerService,
	// 		ITestService testService
	// 	)
	// 	{
	// 		_logger = logger;
	// 		_configuration = configuration;
	// 		_customerService = customerService;
	// 		_testService = testService;
	// 	}
	//
	// 	/// <summary>
	// 	/// 获取 天气 
	// 	/// </summary>
	// 	/// <returns></returns>
	// 	[HttpGet("")]
	// 	public IActionResult Get()
	// 	{
	// 		var rng = new Random();
	// 		int id = 1;
	//
	// 		CusObj cusObj = CustomMethod(id);
	// 		if (!cusObj.B)
	// 		{
	// 			return cusObj.ActionResult;
	// 		}
	//
	// 		return Ok(Enumerable.Range(1, 5).Select(index => new WeatherForecast
	// 			{
	// 				Date = DateTime.Now.AddDays(index),
	// 				TemperatureC = rng.Next(-20, 55),
	// 				Summary = Summaries[rng.Next(Summaries.Length)]
	// 			})
	// 			.ToArray());
	// 	}
	//
	// 	private CusObj CustomMethod(int id)
	// 	{
	// 		if (id > 10)
	// 		{
	// 			return new CusObj() {B = true, ActionResult = Ok("这个可以通过")};
	// 		}
	//
	// 		return new CusObj() {B = false, ActionResult = BadRequest("id不存在")};
	// 	}
	// }
	//
	// public class CusObj
	// {
	// 	public bool B { get; set; }
	// 	public IActionResult ActionResult { get; set; }
	// }
}